﻿using System;
using System.Collections.Generic;
using Hive.Core.Common.Shell;

namespace Hive.Core.Model
{
    /// <summary>
    /// A source repository is an abstraction of a build system that provides
    /// archives of previously built packages.
    /// </summary>
    public interface IBinaryRepository
    {
        /// <summary>
        /// Gets the configuration of the binary repository.
        /// </summary>
        BinaryRepositoryConfiguration Configuration { get; }

        /// <summary>
        /// Gets a binary artifact of a particulary version for a package branch.
        /// </summary>
        /// <param name="packageName">The package name.</param>
        /// <param name="branchName">The branch name.</param>
        /// <param name="versionLabel">The version label.</param>
        /// <param name="shell">The shell.</param>
        /// <returns>The list of artifacts.</returns>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="packageName"/>,
        /// <paramref name="branchName"/>, <paramref name="versionLabel"/> or <paramref name="shell"/> is null.</exception>
        /// <exception cref="BinaryRepositoryException">Thrown if the operation failed.</exception>
        IBinaryArtifact GetArtifact(string packageName, string branchName, string versionLabel, IShell shell);

        /// <summary>
        /// Gets all of the binary artifacts available for a particular package branch.
        /// </summary>
        /// <param name="packageName">The package name.</param>
        /// <param name="branchName">The branch name.</param>
        /// <param name="shell">The shell.</param>
        /// <returns>The list of artifacts.</returns>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="packageName"/>,
        /// <paramref name="branchName"/> or <paramref name="shell"/> is null.</exception>
        /// <exception cref="BinaryRepositoryException">Thrown if the operation failed.</exception>
        IList<IBinaryArtifact> GetArtifacts(string packageName, string branchName, IShell shell);
    }
}
